#ifndef MESSAGEREADEVENT_H_
#define MESSAGEREADEVENT_H_

#include <wx/event.h>
#include "../Buddy.h"

namespace Impp
{

class MessageReadEvent : public wxNotifyEvent
{
private:
	Buddy* sender;

public:
	MessageReadEvent(Buddy* sender, wxEventType eventType = wxEVT_NULL, int id = 0);
	virtual ~MessageReadEvent();

	Buddy* getSender();
	virtual wxEvent* Clone()const;
};

typedef void(wxEvtHandler::*MessageReadEventFunction)(MessageReadEvent&);

BEGIN_DECLARE_EVENT_TYPES()
  DECLARE_EVENT_TYPE(EVT_MESSAGE_READ, -1)
END_DECLARE_EVENT_TYPES()

#define EVT_MESSAGE_READ_MACRO(id, fn) DECLARE_EVENT_TABLE_ENTRY(               \
	EVT_MESSAGE_READ, id, -1, (wxObjectEventFunction)               \
        (wxEventFunction)(MessageReadEventFunction) & fn,                             \
        (wxObject*) NULL),

#define MessageReadEventHandler(func)                                                 \
        (wxObjectEventFunction)                                                \
        (wxEventFunction)wxStaticCastEvent(MessageReadEventFunction, &func)

}

#endif /*MESSAGEREADEVENT_H_*/
